home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 5
/
Apprentice-Release5.iso
/
Source Code
/
C++
/
Applications
/
NeuroSim 1.0
/
Slider ƒ
/
Slider.h
< prev
next >
Wrap
Text File
|
1996-02-19
|
4KB
|
144 lines
//
// ===========================================================================
// Slider.h ©1994 Scott Squires
// ===========================================================================
//
// ***
// *** NOTE: The HorzSlider::GetSliderValue function has been MODIFIED.
// *** I'm distributing this modified version with Scott's permission.
// ***
// *** Timo Eloranta (02/19/1996)
// ***
#pragma once
#include "LView.h"
#include <LBroadcaster.h>
#include <QDOffscreen.h>
#include <UGWorld.h>
class Slider : public LView, public LBroadcaster {
public:
Slider(void);
Slider(short BasePictRes, short SliderPictRest);
Slider(ResIDT BasePictRes, ResIDT SliderPictRes, ResIDT SlideSelectPictRes);
Slider(LStream *inStream);
virtual ~Slider(void);
void SetDefaults(void);
Boolean MakeSlider(void);
void SetPicts(ResIDT BasePictRes, ResIDT SliderPictRes);
void SetPicts(ResIDT BasePictRes, ResIDT SliderPictRes, ResIDT SlideSelectPictRes);
void OffsetSlider(short Xoffset, short Yoffset);
virtual void DrawSelf();
Boolean PointInSlider(Point thePoint);
virtual void ClickSelf(const SMouseDownEvent &inMouseDown) =0; // OverRide
virtual void TrackSlider(Point oldMouse) =0; // OverRide
virtual long GetSliderValue(void) =0; // OverRide
virtual void SetSliderValue(long theValue) =0; // OverRide
void SetMinMax(long theMin, long theMax);
void DoAction(void);
void BroadcastValueMessage();
MessageT GetValueMessage() const;
void SetValueMessage(MessageT inValueMessage);
void SetCursorFlag(Boolean theFlag);
void SetSliderOnlyFlag(Boolean theFlag);
protected:
ResIDT mBasePictID; // PICT res#
ResIDT mSliderPictID;
ResIDT mSliderSelectPictID;
Rect mBasePictRect; // Rectangles
Rect mSliderRect;
LGWorld *mBaseGWorld; // LGWorlds
LGWorld *mSliderGWorld;
LGWorld *mSliderSelectGWorld;
LGWorld *mWorkGWorld;
long mBaseLength; // Pixel size of base picture
long mBaseHeight;
long mMinSliderValue;
long mMaxSliderValue;
MessageT mValueMessage; // message to send
Int32 mValue; // true value
Boolean mSelected; // true if selected/tracking
Boolean mSliderCursor; // false = hide cursor when tracking, true is default
Boolean mSliderOnly; // true means only the slider itself is active
};
//
// ===========================================================================
// HorzSlider Class
// ===========================================================================
//
class HorzSlider : public Slider {
public:
enum {
class_ID = 'Hsld'
};
HorzSlider();
HorzSlider(ResIDT BasePictRes, ResIDT SliderPictRes);
HorzSlider(ResIDT BasePictRes, ResIDT SliderPictRes, ResIDT SlideSelectPictRes);
HorzSlider(LStream *inStream);
static HorzSlider *CreateHorzSliderStream(LStream *inStream);
virtual ~HorzSlider();
void TrackSlider(Point oldMouse);
void ClickSelf(const SMouseDownEvent &inMouseDown);
long GetSliderValue(void);
void SetSliderValue(long theValue);
};
//
// ===========================================================================
// VertSlider Class
// ===========================================================================
//
class VertSlider : public Slider {
public:
enum {
class_ID = 'Vsld'
};
VertSlider();
VertSlider(ResIDT BasePictRes, ResIDT SliderPictRes);
VertSlider(ResIDT BasePictRes, ResIDT SliderPictRes, ResIDT SlideSelectPictRes);
VertSlider(LStream *inStream);
static VertSlider *CreateVertSliderStream(LStream *inStream);
virtual ~VertSlider();
void TrackSlider(Point oldMouse);
void ClickSelf(const SMouseDownEvent &inMouseDown);
long GetSliderValue(void);
void SetSliderValue(long theValue);
};